<?php

class MTransition{
	
	public $id;
	public $title;
	public $desc;
	
	public $destination_state = null;
	
	private $state = null;
	
	const TRIGGER_AUTO = 0;
	const TRIGGER_USER_ACTION = 1;
	const TRIGGER_WORKFLOW_METHOD = 2;
	
	//private $trigger_types = array('auto', 'user_action', 'workflow_method');
	private $current_trigger_type = null;
	
	private $guard; //require a permission, a role or a group role
	
	private $diplay_in_actions = array('Name' => '', 'URL' => '', 'Category' => '');
	private $action;
	
	public function __construct($id, $title=''){
		$this->id = $id;
		$this->title = $title;
	}
	
	public function setDestinationState(MState $state){
		$this->state = $state;
	}
	public function setTriggerType($type){
		if(is_numeric($type) && ($type >=0 && $type <=2))
			$this->current_trigger_type = $type;
	}
	public function getTriggerType(){return $this->current_trigger_type;}
	public function traverse(){}
}
?>